package com.un.ebs.memorial.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import com.un.ebs.core.util.OSSUtil;
import com.un.ebs.core.util.StringUtils;
import org.springframework.stereotype.Component;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 1
 * </p>
 *
 * @author liubo
 * @since 2020-03-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Component
@TableName("v_memorial_record_ext")
public class MemorialRecordExt extends Model<MemorialRecordExt> {

    private static final long serialVersionUID = 1L;

    private String id;

    private String memorialId;

    private String memberId;

    private String recordTypeId;

    private String remark;

    @TableField(fill = FieldFill.INSERT)
    private String createAt;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    private String createAtName;

    private Integer memberType;

    private Integer praiseCount;

    private Boolean isPraise;

    private String createAtLogo;

    public String getCreateAtLogo() {
        if (StringUtils.isNullOrEmpty(this.createAtLogo)) {
            return null;
        } else {
            return OSSUtil.getObjectUrl(this.createAtLogo).toString();
        }
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }

}